package android.slc.module.component.attchment.repository.remote;

import android.slc.appbase.api.slc.callback.po.SlcEntity;
import android.slc.module.component.attchment.entity.AttFileInfo;

import java.util.List;

import io.reactivex.rxjava3.core.Observable;
import okhttp3.MultipartBody;
import retrofit2.Call;
import retrofit2.http.Body;
import retrofit2.http.GET;
import retrofit2.http.Multipart;
import retrofit2.http.POST;
import retrofit2.http.Part;
import retrofit2.http.Query;

/**
 * @author slc
 * @date 2020-09-07 14:40
 */
public interface AttachmentService {

    //@Headers(ApiConstants.KEY_CONTENT_TYPE+": "+ApiConstants.VALUE_APPLICATION_FORM)
    @POST("box/local_storage/upLoad")
    Observable<SlcEntity<AttFileInfo>> uploadFileByBody(@Body MultipartBody multipartBody);
    @Multipart
    @POST("box/local_storage/upLoad")
    Observable<SlcEntity<AttFileInfo>> uploadFileByPart(@Part MultipartBody.Part file);

    @GET("box/local_storage/queryByIds")
    Observable<SlcEntity<List<AttFileInfo>>> findListById(@Query("ids") Long[] ids);

    @GET("box/local_storage/queryByIds")
    Call<SlcEntity<List<AttFileInfo>>> findListByIdByCall(@Query("ids") Long[] ids);
}
